/*-------------------------------------------------------------------------
 *
 * stratnum.h
 *	  POSTGRES 策略编号定义。
 *
 *
 * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/include/access/stratnum.h
 *
 *-------------------------------------------------------------------------
 */
#ifndef STRATNUM_H
#define STRATNUM_H

/*
 * 策略编号标识特定操作符在特定操作符类中的语义。在某些情况下，策略
 * 子类型（OID）被用作进一步的信息。
 */
typedef uint16 StrategyNumber;

#define InvalidStrategy ((StrategyNumber) 0)

/*
 * B-tree 索引的策略编号。
 */
#define BTLessStrategyNumber			1
#define BTLessEqualStrategyNumber		2
#define BTEqualStrategyNumber			3
#define BTGreaterEqualStrategyNumber	4
#define BTGreaterStrategyNumber			5

#define BTMaxStrategyNumber				5

/*
 *	哈希索引的策略编号。哈希只支持一个有效策略：相等。
 */
#define HTEqualStrategyNumber			1

#define HTMaxStrategyNumber				1

/*
 * 与（某些）GiST、SP-GiST 和 BRIN 操作类共有的策略编号。
 *
 * 这些编号中的前几个来自 R-Tree 索引方法（因此得名）；其他编号随着
 * 时间的推移陆续添加。
 */
#define RTLeftStrategyNumber			1	/* for << */
#define RTOverLeftStrategyNumber		2	/* for &< */
#define RTOverlapStrategyNumber			3	/* for && */
#define RTOverRightStrategyNumber		4	/* for &> */
#define RTRightStrategyNumber			5	/* for >> */
#define RTSameStrategyNumber			6	/* for ~= */
#define RTContainsStrategyNumber		7	/* for @> */
#define RTContainedByStrategyNumber		8	/* for <@ */
#define RTOverBelowStrategyNumber		9	/* for &<| */
#define RTBelowStrategyNumber			10	/* for <<| */
#define RTAboveStrategyNumber			11	/* for |>> */
#define RTOverAboveStrategyNumber		12	/* for |&> */
#define RTOldContainsStrategyNumber		13	/* 用于旧拼写的 @> */
#define RTOldContainedByStrategyNumber	14	/* 用于旧拼写的 <@ */
#define RTKNNSearchStrategyNumber		15	/* 用于 <->（距离） */
#define RTContainsElemStrategyNumber	16	/* 范围类型 @> 元素 */
#define RTAdjacentStrategyNumber		17	/* for -|- */
#define RTEqualStrategyNumber			18	/* for = */
#define RTNotEqualStrategyNumber		19	/* for != */
#define RTLessStrategyNumber			20	/* for < */
#define RTLessEqualStrategyNumber		21	/* for <= */
#define RTGreaterStrategyNumber			22	/* for > */
#define RTGreaterEqualStrategyNumber	23	/* for >= */
#define RTSubStrategyNumber				24	/* 对于 inet >> */
#define RTSubEqualStrategyNumber		25	/* 对于 inet <<= */
#define RTSuperStrategyNumber			26	/* for inet << */
#define RTSuperEqualStrategyNumber		27	/* for inet >>= */
#define RTPrefixStrategyNumber			28	/* for text ^@ */
#define RTOldBelowStrategyNumber		29	/* for old spelling of <<| */
#define RTOldAboveStrategyNumber		30	/* for old spelling of |>> */

#define RTMaxStrategyNumber				30


#endif							/* STRATNUM_H */
